package com.sdutcm.health_bigdata_demo.controller;

import com.sdutcm.health_bigdata_demo.bean.Demand;
import com.sdutcm.health_bigdata_demo.service.SupplyAndDemandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * 需求
 * @author 小浩
 * @date 2018-09-23 16:34
 * @package com.sdutcm.health_bigdata_demo.controller
 * @description
 */
@RestController
@RequestMapping("/emand")
public class DemandContrller {
    @Autowired
    SupplyAndDemandService supplyAndDemandService;

    //发布需求
    @RequestMapping("/save")
    public boolean saveDemand(Demand demand){
        return supplyAndDemandService.saveDemand(demand);
    }
    //获取全部需求
    @RequestMapping("/get_all")
    public List getAllDemand(){
        return supplyAndDemandService.getAllDemand();
    }
    //关键字查询需求
    @RequestMapping("/get_all_fuzzy")
    public List getAllDemandFuzzy(String key){
        return supplyAndDemandService.getAllDemandFuzzy(key);
    }
}
